<?php

declare (strict_types=1);

namespace app\model;


use app\BaseModel;
use think\model\concern\SoftDelete;


class SystemRolesModel extends BaseModel
{
    use SoftDelete;

    protected $autoWriteTimestamp = true;
    //软删除
    protected $deleteTime = 'delete_time';
    protected $hidden = ['delete_time'];
    protected $name = 'system_roles';



    public function getRules($rules){
        foreach($rules as $k=>$v){
            $roleRule = self::where('parent_id',$v['id'])->value('id');
            if(!empty($roleRule)){
                unset($rules[$k]);
            }
        }

    }
}